@include("user.head")
<div class="wrapper">
	<div class="col-xs-12 no_padding_both">
		<ol class="breadcrumb">
	      <li><a href="<%url('')%>">碳银网首页</a></li>
	      <li><a href="<%url('industry')%>">低碳产业</a></li>
	      <li><a href="<%url('industry/group')%>">机构</a></li>
	      <li class="active"><%$model["userData"]["company_name"]%></li>
	    </ol>
	</div>
	<div class="row">
		<div class="col-xs-12">
			<div class="col-xs-6 no_padding">
				<img src="<%url('images')%>/<%$model["id"]%>/others/<%$model["userData"]["logo"]%>" height="440" width="480" alt="">
			<!--<div class="col-xs-12 no_padding bianju">
				<div class="col-xs-3 no_padding"><img src="<%url('user/img/project.png')%>"height="80" width="100" alt=""></div>
				<div class="col-xs-3 no_padding"><img src="<%url('user/img/project.png')%>"height="80" width="100" alt=""></div>
				<div class="col-xs-3 no_padding"><img src="<%url('user/img/project.png')%>"height="80" width="100" alt=""></div>
			</div>-->
			</div>
			<div class="col-xs-6">
				<div class="col-xs-12 proritht"><%$model["userData"]["company_name"]%></div>
				<div class="col-xs-12 prorightRice bianju">
					<span class="prorightRice_size">
						<%$model["userData"]["description"]%>
					</span>
				</div>
				<div class="col-xs-12 bianju proContent">
					@if($model['role_id'] == env("ENERGY") || $model['role_id'] == env("SAVER") || $model['role_id'] == env("DEVICE_TECH") || $model['role_id'] == env("THIRD"))
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">
							成立时间:
						</div>
						<div class="col-xs-9">
							<%format($model["userData"]["regist_time"], "Y-m-d") %>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">
							注册资金:
						</div>
						<div class="col-xs-9">
							<%$model["userData"]["regist_capital"]%>万元
						</div>
					</div>
					@if($model['role_id'] == env("SAVER"))
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">
							领域:
						</div>
						<div class="col-xs-9">
							<%$model["userData"]["regist_capital"]%>
						</div>
					</div>
					@endif
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">
							机构类型:
						</div>
						<div class="col-xs-9">
							@if ($model["userData"]["enterprice_char"] == 0)
							民营
							@elseif($model["userData"]["enterprice_char"] == 1)
							国有
							@elseif($model["userData"]["enterprice_char"] == 2)
							中外合资
							@elseif($model["userData"]["enterprice_char"] == 3)
							外商投资
							@endif
						</div>
					</div>
					@endif
				</div>
			</div>
		</div>
	</div>
	@if($model['role_id'] == 2)
		@include("user.industry.energy")
	@elseif($model['role_id'] == 3)
		@include("user.industry.saver")
	@elseif($model['role_id'] == 4)
		@include("user.industry.devicetech")
	@elseif($model['role_id'] == 5)
		@include("user.industry.third")
	@elseif($model['role_id'] == 6)
		@include("user.industry.ass")
	@elseif($model['role_id'] == 7)
		@include("user.industry.gov")
	@endif


</div>
@include("user.footer")
@include("user.common")

<script type="text/html" id="projectList">
{%each list as value index}
<tr>
  <td>
  	<a href="<%url('industry/project/detail?pid=')%>{%value.id}">
		{%value.name}
	</a>
  </td>
  <td>{%value.investment_scale}</td>
  <td>{%noSecond(value.start_time)}</td>
  <td>{%noSecond(value.end_time)}</td>
</tr>
{%/each}
</script>

<script type="text/html" id="circleList">
{%each list as value index}
	<div class="neirong" style="padding-top:15px;">
		<div class="col-xs-2 no_padding_right text-center">
			<img src="<%url('images')%>/{%value.id}/others/{%value.profile.avatar}" class="img-circle" height="65" width="70" alt=""><br>
		</div>
		<div class="col-xs-10 no_padding_left">
			<div class="col-xs-12" style="font-size:16px;"><b>13554911553:</b></div>
			<div class="col-xs-12" style="margin-top:5px;">23123</div>
			<div class="col-xs-12 light_gray999" style="margin-top:10px;font-size:10px;">2015-06-16 16:51</div>
		</div>
	</div>
{%/each}
</script>

<script type="text/html" id="deviceList">
{%each list as value index}
<tr>
  <td>{%value.name}</td>
  <td>{%value.model}</td>
  <td>{%value.creator}</td>
  <td>{%noSecond(value.created_at)}</td>
</tr>
{%/each}
</script>

<script type="text/html" id="techList">
{%each list as value index}
<tr>
  <td>
  	<b>
  		<a href="<%url('industry/tech/detail?tid=')%>{%value.id}">
			{%value.tech_name}
  		</a>
  	</b>
  </td>
  <td><b>{%value.developer}</b></td>
  <td><b>{%noSecond(value.created_at)}</b></td>
</tr>
{%/each}
</script>

<script type="text/html" id="financeList">
{%each list as value index}
<tr>
  <td><b>{%value.name}</b></td>
  <td><b>{%value.investment_scale}</b></td>
  <td><b>{%noSecond(value.start_time)}</b></td>
  <td><b>{%noSecond(value.end_time)}</b></td>
</tr>
{%/each}
</script>

<script type="text/html" id="deviceFinanceList">
{%each list as value index}
<tr>
  <td><b>{%value.name}</b></td>
  <td><b>{%value.model}</b></td>
  <td><b>{%value.creator}</b></td>
  <td><b>{%noSecond(value.created_at)}</b></td>
</tr>
{%/each}
</script>

<script type="text/html" id="techFinanceList">
{%each list as value index}
<tr>
  <td><b>{%value.tech_name}</b></td>
  <td><b>{%value.developer}</b></td>
  <td><b>{%noSecond(value.created_at)}</b></td>
</tr>
{%/each}
</script>

<script type="text/html" id="personList">
{%each list as value index}
<tr>
  <td><b>{%value.real_name}</b></td>
  <td><b>{% value.gender == 1 ?'男' : '女' }</b></td>
  <td><b>{%value.education}</b></td>
  <td><b>{%value.profession}</b></td>
  <td><b>{%value.job}</b></td>
</tr>
{%/each}
</script>

<script type="text/html" id="thirdDevice">
{%each list as value index}
<tr>
  <td>
  	<b>
		<a href="<%url('industry/device/detail?did=')%>{%value.id}">
			{%value.name}
		</a>
  	</b>
  </td>
  <td><b>{%value.num}</b></td>
  <td><b>{%value.functions}</b></td>
  <td><b>{%value.creator}</b></td>
  <td><b>{%noSecond(value.product_time)}</b></td>
  <td><b>{%noSecond(value.created_at)}</b></td>
</tr>
{%/each}
</script>


<script type="text/html" id="thirdProject">
{%each list as value index}
<tr>
  <td>
  	<b>
		{%value.name}
  	</b>
  </td>
  <td><b>{%truncateText(value.content,20)}</b></td>
  <td><b>{%noSecond(value.start_time)}</b></td>
  <td><b>{%noSecond(value.end_time)}</b></td>
</tr>
{%/each}
</script>



<script type="text/javascript">

$("#induction").html(decodeURIComponent("<%$model['userData']['induction']%>"));

var uid = "<%$model['id']%>";
$("#projects").bind("click", function(){
	$.get("get_projects", {uid : uid}, function (data){
		if(data.success && data.data.length){
			var html = template("projectList", {list : data.data});
			$("#projectLists").html(html);
		}else{
			$("#projectLists").html("没有内容!!");
		}
	})
})

$("#circle").bind("click", function (data){
	$.get("get_circle", {uid : uid}, function (data){
		if(data.success && data.data.length){
			var html = template("circleList", {list : data.data});
			$("#circleLists").html(html);
		}else{
			$("#circleLists").html("没有内容!!");
		}
	})
})

$("#devices").bind("click", function (data){
	$.get("get_device",{uid : uid}, function (data){
		if(data.success && data.data.length){
			var html = template("deviceList", {list : data.data});
			$("#deviceLists").html(html);
		}else{
			$("#deviceLists").html('没有内容');
		}
	})
})

$("#techs").bind("click", function(){
	$.get("get_tech", {uid :uid}, function (data){
		if(data.success && data.data.length){
			var html = template("techList", {list : data.data});
			$("#techLists").html(html);
		}else{
			$("#techLists").html('没有内容');
		}
	})
})

$("#financing").bind("click", function(){
	$.get("get_financing_project", {uid : uid}, function (data){
		if(data.success && data.data.length){
			var html = template("financeList", {list : data.data});
			$("#financeProject").html(html);
		}else{
			$("#financeProject").html("没有内容!!");
		}
	})
})

$("#techFinancing").bind("click", function (){
	$.get("get_financing_devicetech", {uid : uid}, function (data){
		if(data.success && data.device.length){
			var html = template("deviceFinanceList", {list : data.device});
			$("#deviceFinanceLists").html(html);
		}else{
			$("#deviceFinanceLists").html("没有内容");
		}
		if(data.success && data.tech.length){
			var html = template("techFinanceList", {list : data.tech});
			$("#techFinanceLists").html(html);
		}else{
			$("#techFinanceLists").html("没有内容");
		}
	})
})


$("#industrys").bind("click", function(){
	$.get("get_third_industry", {uid : uid}, function(data){
		if(data.success && data.person.length){
			var html = template("personList", {list : data.person});
			$("#personLists").html(html);
		}
		if(data.success && data.device.length){
			var html = template("thirdDevice", {list : data.device});
			$("#thirdDevices").html(html);
		}
		if(data.success && data.project.length){
			var html = template("thirdProject", {list : data.project});
			$("#thirdProjects").html(html);
		}
	})
})





</script>
